<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<%@taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt"%>
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>博客管理界面</title>
<link rel="stylesheet" href="bs/css/bootstrap.css">
<script src="bs/js/jquery-3.3.1.min.js"></script>
<script src="bs/js/bootstrap.min.js"></script>
<style>
.container {
	margin-top: 30px;
	width: 1280px !important;
	max-width: none !important;
}

.row {
	margin-bottom: 15px;
}

.articletable {
	margin-top: 70px;
}
</style>
</head>
<body>
	<div class="container">
		<div>
			<h2>
				<small>Author:${sessionScope.ADMIN_IN_SESSION.username}</small>
			</h2>
		</div>
		<div align="right">
			<a href="/admin">注销登录</a>
		</div>
		<div class="btn-group btn-group-justified">
			<div class="btn-group">
				<a href="/checklogin"><button class="btn btn-danger">博客</button></a>
			</div>
			<div class="btn-group">
				<a href="/msg"><button class="btn btn-primary">留言板</button></a>
			</div>
			<div class="btn-group">
				<a href="/sharemusic"><button class="btn btn-warning">音乐分享</button></a>
			</div>
			<div class="btn-group">
				<a href="/sharemovie"><button class="btn btn-active">电影分享</button></a>
			</div>
			<div class="btn-group">
				<a href="/password"><button class="btn btn-success">密码修改</button></a>
			</div>
		</div>
		<div style="position: relative; top: 10%">
			<c:if test="${!empty isSuccess}">
				<div class="alert alert-warning" role="alert">${isSuccess}</div>
			</c:if>
		</div>
		<h2>留言板</h2>
		<table class="table table-striped table-bordered table-hover">
			<tr class="info">
				<th>昵称</th>
				<th>留言内容</th>
				<th>联系方式</th>
				<th>ip地址</th>
				<th>留言时间</th>
				<th>Operator</th>
			</tr>
			<c:forEach var="msg" items="${message}" varStatus="vs">
				<tr style='color: orange'>
					<td>${msg.name}</td>
					<td>${msg.content }</a></td>
					<td>${msg.qqNumber }</td>
					<td>${msg.msgIp }</td>
					<td><fmt:formatDate value="${msg.msgDate}"
							pattern="yyyy-MM-dd HH:mm:ss" /></td>
					<td><a href="/msgDelete?id=${msg.id}">删除</a></td>
				</tr>
			</c:forEach>
		</table>
		<nav aria-label="Page navigation">
			<ul class="pagination">
				<li><a href="/msg?page=${pageInfo.prePage }"
					aria-label="Previous"> <span aria-hidden="true">&laquo;</span>
				</a></li>
				<c:forEach begin="1" step="1" end="${pageInfo.pages }" var="i">
					<!--对当页按钮增加颜色-->
					<li class="${i eq pageInfo.pageNum ? 'active':''}"><a
						href="/msg?page=${i }">${i }</a></li>
				</c:forEach>
				<li><a href="/msg?page=${pageInfo.nextPage}"
					aria-label="Next"> <span aria-hidden="true">&raquo;</span>
				</a></li>
				<li
					style="font-weight: 700; color: olive; font-family: cursive; margin-left: 800px">Total：${pageInfo.total }</li>
			</ul>
		</nav>
	</div>
</body>
</html>